package org.txazo.blog.util.log;

import org.apache.log4j.Logger;

/**
 * 日志管理
 * 
 * @author Tu XiaoZhou
 * @since 2013-08-10
 */
public class LoggerManager {

	/** 控制台标准输出日志 */
	private static final String LOGGER_CONSOLE = "console";
	/** PV访问日志 */
	private static final String LOGGER_PV = "pv";
	/** JDBC操作日志 */
	private static final String LOGGER_JDBC = "jdbc";
	/** 登录日志 */
	private static final String LOGGER_LOGIN = "login";
	/** 注册日志 */
	private static final String LOGGER_REGISTER = "register";
	/** 异常日志 */
	private static final String LOGGER_EXCEPTION = "exception";

	/** 获取控制台标准输出日志 */
	public static Logger getConsoleLogger() {
		return getLogger(LOGGER_CONSOLE);
	}

	/** 获取PV访问日志 */
	public static Logger getPVLogger() {
		return getLogger(LOGGER_PV);
	}

	/** 获取JDBC操作日志 */
	public static Logger getJdbcLogger() {
		return getLogger(LOGGER_JDBC);
	}

	/** 获取登录日志 */
	public static Logger getLoginLogger() {
		return getLogger(LOGGER_LOGIN);
	}

	/** 获取注册日志 */
	public static Logger getRegisterLogger() {
		return getLogger(LOGGER_REGISTER);
	}

	/** 获取异常日志 */
	public static Logger getExceptionLogger() {
		return getLogger(LOGGER_EXCEPTION);
	}

	/** 获取日志 */
	private static Logger getLogger(String loggerName) {
		return Logger.getLogger(loggerName);
	}

}
